﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

/// <summary>
/// Summary description for ProductBOL
/// </summary>
public class ProductBOL
{
	public ProductBOL()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public DataTable LoadProduct()
    {
        ProductDAL pDAL = new ProductDAL();
        try 
        {
            return pDAL.LaodProduct();
        }
        catch
        {
            throw;
        }
    }
    public int insertProduct(Product p)
    {
        ProductDAL pDAL = new ProductDAL();
        try
        {
            return pDAL.insertProduct(p);
        }
        catch
        {
            throw;
        }
        finally
        {
            pDAL = null;
        }
    }
    public int deleteProduct(Product p)
    {
        ProductDAL pDAL = new ProductDAL();
        try
        {
            return pDAL.deleteProduct(p);
        }
        catch
        {
            throw;
        }
        finally
        {
            pDAL = null;
        }
    }
    public int updateProduct(Product p)
    {
        ProductDAL pDAL = new ProductDAL();
        try
        {
            return pDAL.updateProduct(p);
        }
        catch
        {
            throw;
        }
        finally
        {
            pDAL = null;
        }
    }
    public int updateProductQuantityInStock(Product p)
    {
        ProductDAL pDAL = new ProductDAL();
        try
        {
            return pDAL.updateProductQuantityInStock(p);
        }
        catch
        {
            throw;
        }
        finally
        {
            pDAL = null;
        }
    }
}